import React from 'react';
import Card from '../../../components/card';
import './tradeInfo.scss';

interface TradeInfoCardProps extends OrderInfo {}

class TradeInfoCard extends React.Component<TradeInfoCardProps> {
    cardInfo: {
        width: string;
        title: string;
    }
    constructor (props: TradeInfoCardProps) {
        super(props);
        this.cardInfo = {
            width: '20%',
            title: '订单信息',
        };
    }

    render () {
        const { title, width } = this.cardInfo;
        const { tId, payTime, consignTime } = this.props;
        return (<Card title={title} width={width}>
            {
                <div className='orderInfo'>
                    <div className='orderInfoLabel'>
                        <span style={{ flexShrink: 0 }}>订单编号：</span>
                        <span className='tid-list'>{tId.split(',').map((val: string) => <span key={val}>{val}</span>)}</span>
                    </div>
                    <p className='orderInfoLabel'>成交时间：{payTime}</p>
                    <p className='orderInfoLabel'>发货时间：{consignTime}</p>
                </div>
            }
        </Card>);
    }
}

export default TradeInfoCard;
